#ifndef INT2BIN_H_
#define INT2BIN_H_
#include <bitset>
#include <iostream>
#include <limits>
#include <sstream>
#include <string>
template<typename T>
std::string to_bin(const T& value)
{
const std::bitset<std::numeric_limits<T>::digits + 1> bs(value);
const std::string s(bs.to_string());
const std::string::size_type pos(s.find_first_not_of('0'));
return pos == std::string::npos ? "0" : s.substr(pos);
};
#endif //INT2BIN_H_
